// 全局类型定义

// 扩展Window接口，添加electronAPI
declare global {
  interface Window {
    electronAPI: {
      // 照片相关API
      photos: {
        getList: (params: any) => Promise<any>
        getById: (params: { id: number }) => Promise<any>
        update: (params: { id: number; updates: any }) => Promise<any>
        delete: (params: { id: number }) => Promise<any>
        deleteMultiple: (params: { ids: number[] }) => Promise<any>
        updateMultiple: (params: { ids: number[]; updates: any }) => Promise<any>
        getThumbnail: (params: { id: number }) => Promise<any>
      }
      
      // 相册相关API
      albums: {
        getList: (params: any) => Promise<any>
        getById: (params: { id: number }) => Promise<any>
        create: (params: { name: string; description?: string }) => Promise<any>
        update: (params: { id: number; updates: any }) => Promise<any>
        delete: (params: { id: number }) => Promise<any>
        addPhoto: (params: { albumId: number; photoId: number }) => Promise<any>
        removePhoto: (params: { albumId: number; photoId: number }) => Promise<any>
      }
      
      // 搜索相关API
      search: {
        query: (params: any) => Promise<any>
        photos: (params: any) => Promise<any>
        albums: (params: any) => Promise<any>
        tags: (params: any) => Promise<any>
        getSuggestions: (params: { type: string; query: string }) => Promise<any>
        getPopularTags: (params?: { limit?: number }) => Promise<any>
        getAllTags: () => Promise<any>
        getCameraMakes: () => Promise<any>
        getCameraModels: (params?: { make?: string }) => Promise<any>
      }
      
      // 系统相关API
      system: {
        openFile: (params: { filePath: string }) => Promise<any>
        showInFolder: (params: { filePath: string }) => Promise<any>
        getAppVersion: () => Promise<any>
        checkForUpdates: () => Promise<any>
        selectFolder: () => Promise<any>
        selectFile: (params?: { filters?: any[]; multiple?: boolean }) => Promise<any>
        getUserDataPath: () => Promise<any>
        getTempPath: () => Promise<any>
        getDocumentsPath: () => Promise<any>
        getPicturesPath: () => Promise<any>
        showMessageBox: (params: {
          type?: 'none' | 'info' | 'error' | 'question' | 'warning'
          title: string
          message: string
          buttons?: string[]
        }) => Promise<any>
      }
      
      // 事件监听
      on: (channel: string, callback: (...args: any[]) => void) => void
      off: (channel: string, callback: (...args: any[]) => void) => void
    }
  }
}

export {}